import * as actionTypes from './actionTypes'
import { fromJS } from 'immutable'
const defaultState = fromJS({
    focused: false,
    list: []
})
export default (state = defaultState, action) => {
    if(action.type === actionTypes.INPUT_FOCUS){
        return state.set('focused',true)
    }
    if(action.type === actionTypes.INPUT_BLUR){
        return state.set('focused',false)
    }
    if(action.type === actionTypes.INPUT_BLUR){
        return state.set('focused',false)
    }
    if(action.type === actionTypes.GET_SERCH_LIST){
        console.log(action.data)
        return state.set('list',action.data)
    }
    return state
}